Skip to content

External network members endpoints - #302

Draft
iljarotar wants to merge 39 commits into
mainfrom
external-network-members-endpoints
Draft

External network members endpoints#302
iljarotar wants to merge 39 commits into
mainfrom
external-network-members-endpoints

Conversation

@iljarotar

@iljarotar iljarotar commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Description

Implements endpoints for external network members. An external member is a host that is connected to one of our racks but is not itself registered at the api.

depends on metal-stack/api#188

TODO

  • validate network type
  • validate only unmanaged ports can be added as external members
  • validate machine register is only allowed for internal or unmanaged ports
  • when a machine registers at an unmanaged port it must be set to internal
  • when a machine gets deleted from the database the port must be set to unmanaged
  • add migration during switch heartbeat to add memberships to all ports

Some issues remain:

  • lazy migration doesn't catch all instances of unspecified memberships
  • adding a port without a bgp speaker on the other end results in an empty neighbor hostname which fails the proto validation

@metal-robot metal-robot Bot added the area: control-plane Affects the metal-stack control-plane area. label Sep 2, 2026
@metal-robot metal-robot Bot added this to Development Sep 2, 2026
@iljarotar
iljarotar marked this pull request as ready for review September 2, 2026 09:35
@iljarotar
iljarotar requested a review from a team as a code owner September 2, 2026 09:35
@codecov

codecov Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.75064% with 56 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.06%. Comparing base (c32f5bf) to head (1ff4ab7).

Files with missing lines Patch % Lines
pkg/test/scenarios/spec.go 64.28% 15 Missing ⚠️
pkg/db/generic/initialize.go 7.69% 12 Missing ⚠️
pkg/repository/network.go 95.00% 7 Missing ⚠️
pkg/service/infra/switch/switch-service.go 33.33% 6 Missing ⚠️
pkg/db/metal/switch.go 88.23% 4 Missing ⚠️
pkg/repository/switch.go 89.74% 4 Missing ⚠️
pkg/test/datacenter.go 82.60% 4 Missing ⚠️
pkg/repository/switch-validation.go 71.42% 2 Missing ⚠️
cmd/server/datastore-cmd.go 0.00% 1 Missing ⚠️
pkg/test/scenarios/funcs.go 98.61% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #302      +/-   ##
==========================================
+ Coverage   79.95%   80.06%   +0.11%     
==========================================
  Files         199      200       +1     
  Lines       14811    15066     +255     
==========================================
+ Hits        11842    12063     +221     
- Misses       2968     3002      +34     
  Partials        1        1              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread pkg/db/generic/integer_pool.go Outdated
Comment thread go.mod Outdated
Comment thread pkg/repository/network.go Outdated
@vknabel vknabel moved this to In Progress in Development Sep 7, 2026
@vknabel
vknabel requested a review from majst01 September 7, 2026 12:11
Comment thread pkg/db/metal/switch.go
}
}

// FIXME: shouldn't we return an error if a machine sees a neighbor but we can't find the nic on the switch?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might be a good issue to work on at a later point in time

Comment thread pkg/repository/network.go Outdated
continue
}

if nic.Vrf != fmt.Sprintf("Vrf%d", nw.Vrf) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if this fmt.Sprintf happens more offen, it could be useful to have a Stringer() func on the Vrf

@iljarotar
iljarotar marked this pull request as draft September 9, 2026 08:30
@iljarotar
iljarotar force-pushed the external-network-members-endpoints branch from 1f08069 to d28ab79 Compare September 9, 2026 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: control-plane Affects the metal-stack control-plane area.

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

3 participants